import com.yuyou.fn.educational.vo.ExamPaperSaveOrUpdateVo;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by wens on 16-11-30.
 */
public class GenerateApiImplicitParams {

    public static void main(String[] args) {

        Class<?> clazz = ExamPaperSaveOrUpdateVo.class ;
        Field[] fields = clazz.getDeclaredFields();
        List<String> params = new ArrayList<>();
        for(Field field : fields){
            //System.out.println(field.get);
            String fieldName = field.getName();
            params.add("@ApiImplicitParam(value = \""+fieldName+"\" ,required = false)") ;
        }
        System.out.println("@ApiImplicitParams({"+ StringUtils.join(params ,",")+"})");
    }
}
